package com.cosc716.restaurant.domain;

import java.util.ArrayList;

public class Tab {
	
	private Customer customer = null;
	private Table table = null;
	private boolean isPaid = false;
	private ArrayList<MenuItem> order = new ArrayList<MenuItem>();
	
	public Tab(Customer customer, Table table) {
		this.customer = customer;
		this.table = table;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomerId(Customer customer) {
		this.customer = customer;
	}

	public boolean isPaid() {
		return isPaid;
	}

	public void setPaid(boolean isPaid) {
		this.isPaid = isPaid;
	}

	public Table getTable() {
		return table;
	}

	public void setTable(Table table) {
		this.table = table;
	}
	
	public void placeOrder(MenuItem MenuItem) {
		order.add(MenuItem);
	}
	
	public void placeOrder(ArrayList<MenuItem> order) {
		order.addAll(order);
	}
	
	public ArrayList<MenuItem> getOrder() {
		return order;
	}
	
	public double getTotalOrderPrice() {
		double total = 0.0;
		
		for(MenuItem MenuItem : order) {
			total += MenuItem.getPrice();
		}
		
		return total;
	}
	
}
